Many programming languages allow development of programs or applications that will be implemented in a virtual machine. The virtual machine is designed to allow “platform-independent” development. The basic principle of a virtual machine environment is that the executable code exists as “intermediate state,” or intermediate form, code, or code in a state that still will be evaluated or interpreted by a virtual machine layer to essentially translate the program code into instructions executable on a hardware and operating system environment of the computing device on which the virtual machine executes. JAVA (of SUN MICROSYSTEMS of Sunnyvale, Calif.) is a well-known example. PERL (of the PERL FOUNDATION) is an example of a programming language that uses an intermediate state of code. Note that all trademarks used herein are used solely for purposes of identification of a source of a product. All trademarks are the property of their respective owners.
Programming languages that do not use a virtual machine layer or intermediate state code are implemented with a compiler that converts human-readable code written in the programming language into machine-executable code made up of instructions within an instruction set supported by a particular hardware and operating system environment, also referred to as a platform. Accordingly, such programming languages require, for each platform on which a program written in the program language is to be executed, separate compilers and separate compiling of human-readable code.
Virtual machines allow development of what is frequently referred to as “portable” code, or a “platform-independent” implementation. Platform-independent implementations allow human-readable code to be converted into a single format for execution on multiple platforms with a single compiler. The single compiler converts the human-readable code into an intermediate form, rather than into machine-executable instructions. The intermediate form is made up of a platform-independent instruction set, which instruction set is supported by the virtual machine. The virtual machine is effectively a virtual platform or architecture supporting the instruction set that makes up the intermediate form.
The virtual machine in turn is implemented on various platforms, where each implementation of the virtual machine is capable of executing the intermediate code. In this way, the intermediate code is platform independent, and execution of the intermediate code on a computing system is limited only by the existence of a virtual machine environment for a given platform. Thus, when a virtual machine is implemented for a given platform, that platform becomes automatically capable of executing all programs compiled into the intermediate form, without having to re-compile the human-readable, or source, code.
An example of a programming language that uses a virtual machine layer is JAVA. FIG. 1 illustrates an exemplary implementation of known virtual machines. Human-readable code, or source code 102 is processed by compiler 104, which converts source code 102 into an intermediate form, as shown by byte code 106. The compiling of source code 102 into byte code 106 is understood to take place at “design time,” referring to some time before execution of the program.
At runtime, or a time or times when byte code 106 is executed by virtual machine 110, the individual instructions making up byte code 106 are evaluated within virtual machine 110 by reference to function table 120. Function table 120 stores, for each function, a reference to machine-executable function definition, such as 116. Thus, intermediate instruction 112 is evaluated as reference 114 to entry 122 in function table 120. Entry 122 in turn is evaluated as reference 124 to function definition 116.
While a virtual machine layer in the implementation of a programming language creates a great deal of flexibility, it does not provide all the flexibility that developers might desire. When a platform introduces new capabilities, a developer must wait until the virtual machine implementation for the platform is updated to use those capabilities if he wishes to gain their benefit. For example, if a given platform adds new instructions to support 64-bit arithmetic, but the virtual machine implementation of that platform remains limited to instructions for 32-bit arithmetic, a developer cannot use the new 64-bit instructions on that implementation. Also, there exists a great deal of “legacy” code for legacy programs that may have been developed in the past. While the executable or intermediate form of the code for the legacy programs may exist, sometimes the source code is not available. Thus, for legacy programs, it may not be possible in traditional systems to change the program in the virtual machine.